<?php
session_start ();
require_once ("../commun/ouvre_base.php");
// ~ $link = mysqli_connect($host, $userbase, $passwd) or die('Impossible de se connecter pour récupérer niveau : ' . mysql_error());
mysql_select_db ( $db ) or die ( 'Impossible de s&#233;lectionner la base de donn&#233;es' );
// ~ mysqli_select_db($link,$db) or die('Impossible de s&#233;lectionner la base de donn&#233;es');

$_SESSION ['pathway'] = '..';
$_SESSION ['pathway_js'] = '/clinique';
include_once ($_SESSION ['pathway'] . "/header.php");

$score = 0;
if (! isset ( $_SESSION ['id'] )) {
	echo "<table class='principale'><tr><td>Session expired</td></tr>";
	echo "<a href='" . $_SESSION ['pathway'] . "/index.php'>Start</a></table>";
} elseif ($_SESSION ['acces_clinique'] == 0) {
	echo "<table class='principale'><tr><td>Restricted area</td></tr>";
	echo "<a href='" . $_SESSION ['pathway'] . "/start.php'>Start</a></table>";
} else {
	
	$action = $_GET ['action'];
	$table = 'fiche_activite';
	if ($action == 'edit') {
		echo "<img src='" . $_SESSION ['pathway'] . "/images/modifier.png' height='20' alt='modifier.png' /> ";
	} else if ($action == 'insert') {
		echo "<img src='" . $_SESSION ['pathway'] . "/images/add-icon.png' height='20' alt='button_add.png' /> ";
	}
	// ~ $index = $_SESSION['form'];s
	echo ucfirst ( $action ) . ' Activity index' . " </p>";
	
	$hash_champ_valeur = array ();
	if ($action == 'edit') { // on récupère les données dans la index déjà dans la base
		$index = $_GET ['index'];
		$requete_index = "SELECT * FROM `" . $table . "`
		WHERE `index` LIKE " . $index . ";";
		// ~ echo $requete_index;
		$result_requete_index = mysql_query ( $requete_index ) or die ( "Impossible de recupérer les entetes : " . mysql_error () );
		// ~ $result_requete_index = mysqli_query($link,$requete_index) or die("Impossible de recupérer les entetes : " . mysql_error());
		
		while ( $ligne = mysql_fetch_assoc ( $result_requete_index ) ) {
			// ~ while($ligne = mysqli_fetch_assoc($result_requete_index)) {
			foreach ( $ligne as $champ => $valeur ) {
				$hash_champ_valeur [$champ] = $valeur;
			}
		}
		// print_r($hash_champ_valeur);
	} elseif ($action == 'insert') {
		$table = 'fiche_activite';
		require_once ("./requetes/recupere_max_fiche_activite.php");
		$today = getdate ();
		$current_date = $today ['year'] . '-' . $today ['mon'] . '-' . $today ['mday'];
		
		$index = $_SESSION ['index'];
	} else {
		echo "error";
	}
	
	// ~----------------------------------- indexulaire fiche activité
	
	$disabled_tous = '';
	if ($_SESSION ['acces_clinique'] >= 2) {
		?><form
	action="./requetes/remplissage_fiche_activite.php?action=<?php echo $action; ?>&amp;index=<?php echo $index; ?>&amp;table=fiche_activite"
	method='post' enctype='multipart/index-data'><?php
	} else {
		$disabled_tous = 'disabled';
	}
	$disabled_droits_supremes = '';
	if ($_SESSION ['acces_clinique'] < 3) {
		$disabled_droits_supremes = 'disabled';
	}
	
	?>
	
	<table class='principale'>
		<tr>
			<td><i>User : </i><input <?php echo $disabled_tous.' ';?> type="text"
				name="user" readonly="readonly" style="width: 200px; border: none;"
				value="<?php
	if (isset ( $hash_champ_valeur ['user'] ) and $hash_champ_valeur ['user'] != '') { // on considère que le champ est egal à '' uniquement lors de la création de la fiche qu'il n'est jamais vide après
		echo strtoupper ( $hash_champ_valeur ['user'] );
	} else {
		$hash_champ_valeur ['user'] = $_SESSION ['id'];
		echo strtoupper ( $hash_champ_valeur ['user'] );
	}
	?>" /></td>
			<td><i>Last modifier : </i><input <?php echo $disabled_tous;?>
				type="text" name="last_modifier" readonly="readonly"
				style="width: 200px; border: none;"
				value="<?php
	if (isset ( $hash_champ_valeur ['last_modifier'] ) and $hash_champ_valeur ['last_modifier'] != '') {
		echo strtoupper ( $hash_champ_valeur ['last_modifier'] );
	} else {
		echo strtoupper ( $hash_champ_valeur ['user'] );
	}
	?>" /></td>
		</tr>
	</table>



	<table class='principale'>

		<tr>
			<td colspan="2"><h2> Activity index nr <?php echo $index; ?> </h2> <i>Attached
					to SPATAX index nr <input type="text" readonly="readonly"
					style="border: none;" name="fiche_spatax_attachee"
					value="<?php if(isset($hash_champ_valeur['fiche_spatax_attachee'])){ 	echo $hash_champ_valeur['fiche_spatax_attachee']; 	}else if(isset($_GET['fiche_spatax_attachee']) and $_GET['action'] == 'insert'){		 echo $_GET['fiche_spatax_attachee']; 		 }else{			  echo '';} ?>" />
			</i></td>
		</tr>

		<tr>
			<td><br /> <br /> <br /></td>
		</tr>

		<tr>
			<td><br /> <b>Date </b></td>
			<td><br /> <input type="text" style="width: 100px;" name="date"
				value="<?php if(isset($hash_champ_valeur['date'])){ echo $hash_champ_valeur['date']; }else{ echo $current_date; } ?>" />&#40;yyyy&#45;mm&#45;dd&#41;</td>
			<td><br />NIP : <input type="text" style="width: 150px;" name="nip"
				value="<?php if(isset($hash_champ_valeur['nip'])){ 	echo $hash_champ_valeur['nip']; 	}else if(isset($_GET['nip']) and $_GET['action'] == 'insert'){		 echo $_GET['nip']; 		 }else{			  echo '';} ?>" /></td>
		</tr>

		<tr>
			<td><b>Neurologist : </b></td>
			<td><input type="text" style="width: 100px;" name="neurologist"
				value="<?php if(isset($hash_champ_valeur['neurologist'])){ echo strtoupper($hash_champ_valeur['neurologist']); } ?>" /></td>
		
		
		<tr>
			<td><br /> <b>Site </b></td>
			<td><select size='1' id='site' name='site'>
					<option></option>
					<option value='SALPETRIERE - ATAXIES_PS'
						<?php if(isset($hash_champ_valeur['site']) and $hash_champ_valeur['site'] == 'SALPETRIERE - ATAXIES_PS'){ echo "selected='selected'"; } ?>>
						SALPETRIERE - ATAXIES_PS</option>
					<option value='SALPETRIERE - MOUVEMENTS ANORMAUX'
						<?php if(isset($hash_champ_valeur['site']) and $hash_champ_valeur['site'] == 'SALPETRIERE - MOUVEMENTS ANORMAUX'){ echo "selected='selected'"; } ?>>
						SALPETRIERE - MOUVEMENTS ANORMAUX</option>
					<option value='TROUSSEAU'
						<?php if(isset($hash_champ_valeur['site']) and $hash_champ_valeur['site'] == 'TROUSSEAU'){ echo "selected='selected'"; } ?>>
						TROUSSEAU</option>
			</select></td>
		</tr>



		<tr>
			<td><br /> <b>Patient </b></td>
			<td><br /> <b>Sexe </b><br /> <label><input type="radio" name="sex"
					value="female"
					<?php if(isset($hash_champ_valeur['sex']) and $hash_champ_valeur['sex'] == 'female'){ echo "checked='checked'"; } ?> />Femme</label>
				<label><input type="radio" name="sex" value="male"
					<?php if(isset($hash_champ_valeur['sex']) and $hash_champ_valeur['sex'] == 'male'){ echo "checked='checked'"; } ?> />Homme</label></td>
		</tr>
		<tr>
			<td></td>
			<td><b>Date de naissance </b><br /> <input type="text"
				style="width: 100px;" name="birthdate"
				value="<?php if(isset($hash_champ_valeur['birthdate'])){ echo $hash_champ_valeur['birthdate']; } ?>" />&#40;yyyy&#45;mm&#45;dd&#41;</td>
		</tr>

		<tr>
			<td><br /> <b>Origine g&eacute;ographique : </b></td>
			<td><br /> <label><input type="radio" name="location"
					value="Ile de France"
					<?php if(isset($hash_champ_valeur['location']) and $hash_champ_valeur['location'] == 'Ile de France'){ echo "checked='checked'"; } ?> />Ile
					de France</label><br /> <label><input type="radio" name="location"
					value="France, hors IDF"
					<?php if(isset($hash_champ_valeur['location']) and $hash_champ_valeur['location'] == 'France, hors IDF'){ echo "checked='checked'"; } ?> />France,
					hors IDF</label><br /> <label><input type="radio" name="location"
					value="Union Europeenne"
					<?php if(isset($hash_champ_valeur['location']) and $hash_champ_valeur['location'] == 'Union Europeenne'){ echo "checked='checked'"; } ?> />Union
					Europ&eacute;enne</label><br /> <label><input type="radio"
					name="location" value="Hors UE"
					<?php if(isset($hash_champ_valeur['location']) and $hash_champ_valeur['location'] == 'Hors UE'){ echo "checked='checked'"; } ?> />Hors
					UE</label><br /></td>
			<td><br />Si hors Ile de France, pr&eacute;ciser (d&eacute;partement
				ou pays) : <input type="text" style="width: 100px;"
				name="location_other"
				value="<?php if(isset($hash_champ_valeur['location_other'])){ echo strtoupper($hash_champ_valeur['location_other']); } ?>" /></td>
		</tr>

		<tr>
			<td colspan="4"><br />
				<hr width="100%"></td>
		</tr>

		<tr>
			<td><b>DIAGNOSTIC</b></td>
		</tr>
		<tr>
			<td><br /> <b>Maladie concern&eacute;e <br />(suspect&eacute;e ou
					affirm&eacute;e)
			</b></td>
			<td><br /> <label><input type="checkbox" name="diagnostic[]"
					value="Ataxie"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Ataxie/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Ataxie</label><br />
				<label><input type="checkbox" name="diagnostic[]"
					value="Choree \(non HD\)"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Choree \(non HD\)/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Chor&eacute;e
					(non HD)</label><br /> <label><input type="checkbox"
					name="diagnostic[]" value="Dystonie"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Dystonie/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Dystonie</label><br />
				<label><input type="checkbox" name="diagnostic[]"
					value="Encephalopathie"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Encephalopathie/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Enc&eacute;phalopathie</label><br />
				<label><input type="checkbox" name="diagnostic[]"
					value="Leucodystrophie"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Leucodystrophie/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Leucodystrophie
			</label><br /> <label><input type="checkbox" name="diagnostic[]"
					value="Mouvements anormaux paroxystiques"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Mouvements anormaux paroxystiques/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Mouvements
					anormaux paroxystiques </label><br /> <label><input type="checkbox"
					name="diagnostic[]" value="Myoclonies"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Myoclonies/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Myoclonies
			</label><br /> <label><input type="checkbox" name="diagnostic[]"
					value="Paraplegie spastique"
					<?php if(isset($hash_champ_valeur['diagnostic']) and preg_match("/Paraplegie spastique/", $hash_champ_valeur['diagnostic'])){ echo "checked='checked'"; } ?>>Parapl&eacute;gie
					spastique</label></td>
			<td><br />Autre : <input type="text" style="width: 100px;"
				name="diagnostic_other"
				value="<?php if(isset($hash_champ_valeur['diagnostic_other'])){ echo strtoupper($hash_champ_valeur['diagnostic_other']); } ?>" /></td>
		</tr>

		<tr>
			<td><br /> <b>Diagnostic g&eacute;n&eacute;tique connu </b></td>
			<td><br /> <label><input type="radio" name="diagnostic_genetique"
					onchange='toggleDiagnosticConnu(this.value)' value="oui"
					<?php if(isset($hash_champ_valeur['diagnostic_genetique']) and $hash_champ_valeur['diagnostic_genetique'] == 'oui'){ echo "checked='checked'"; } ?> />Oui</label><br />
				<label><input type="radio" name="diagnostic_genetique"
					onchange='toggleDiagnosticConnu(this.value)' value="non"
					<?php if(isset($hash_champ_valeur['diagnostic_genetique']) and $hash_champ_valeur['diagnostic_genetique'] == 'non'){ echo "checked='checked'"; } ?> />Non</label><br /></td>
			<td><br />Specifiez :<input type="text" style="width: 100px;"
				name="diagnostic_genetique_specify"
				value="<?php if(isset($hash_champ_valeur['diagnostic_genetique_specify'])){ echo strtoupper($hash_champ_valeur['diagnostic_genetique_specify']); } ?>" /></td>
		</tr>

		<tr>
			<td><br /> <b>Diagnostic clinique complet </b></td>
			<td colspan="3"><br /> <textarea cols="80" name="diagnostic_complet"><?php if(isset($hash_champ_valeur['diagnostic_complet'])){ echo $hash_champ_valeur['diagnostic_complet']; } ?></textarea></td>
		</tr>

		<tr>
			<td><br /> <b>Mode de transmission : </b></td>
			<td colspan="3">
				<table class='normale'>
					<tr>
						<td><br /> <label><input type="checkbox" name="mode[]" value="AD"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/AD/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>AD</label><br />
							<label><input type="checkbox" name="mode[]" value="AR"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/AR/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>AR</label><br />
							<label><input type="checkbox" name="mode[]" value="recessif"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/recessif/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>R&eacute;cessif</label><br />
							<label><input type="checkbox" name="mode[]" value="sporadique"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/sporadique/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>Sporadique</label><br />
							<br /> <label><input type="checkbox" name="mode[]"
								value="sporadique avec censure"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/sporadique avec censure/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>Sp.
								avec censure</label><br /> <label><input type="checkbox"
								name="mode[]" value="sporadique sans censure"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/sporadique sans censure/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>Sp.
								sans censure</label><br /> <br /> <label><input type="checkbox"
								name="mode[]" value="X linked"
								<?php if(isset($hash_champ_valeur['mode']) and preg_match("/X linked/", $hash_champ_valeur['mode'])){ echo "checked='checked'"; } ?>>Li&eacute;
								&agrave; l&#39;X</label><br />
						
						<td>Autre : <input type="text" style="width: 100px;"
							name="mode_other"
							value="<?php if(isset($hash_champ_valeur['mode_other'])){ echo strtoupper($hash_champ_valeur['mode_other']); } ?>" /></td>
					</tr>
				</table>
			</td>
		</tr>



		<tr>
			<td colspan="4"><br />
				<hr width="100%"></td>
		</tr>

		<tr>
			<td><b>PRISE EN CHARGE ET ORIENTATION</b></td>
		</tr>

		<tr>
			<td></td>
			<td><br /> <label><input type="radio" name="nouveau_patient"
					value="Patient deja connu du center"
					<?php if(isset($hash_champ_valeur['nouveau_patient']) and $hash_champ_valeur['nouveau_patient'] == 'Patient deja connu du center'){ echo "checked='checked'"; } ?> />Patient
					d&eacute;j&agrave; connu du center</label><br /> <label><input
					type="radio" name="nouveau_patient" value="Nouveau patient"
					<?php if(isset($hash_champ_valeur['nouveau_patient']) and $hash_champ_valeur['nouveau_patient'] == 'Nouveau patient'){ echo "checked='checked'"; } ?> />Nouveau
					patient</label><br /></td>
		</tr>

		<tr>
			<td><br /> <b>Type de prise en charge <br /> ou avis donn&eacute;
			</b></td>
			<td><br /> <label><input type="radio" name="prise_en_charge"
					value="Consultation"
					<?php if(isset($hash_champ_valeur['prise_en_charge']) and $hash_champ_valeur['prise_en_charge'] == 'Consultation'){ echo "checked='checked'"; } ?> />Consultation</label><br />
				<label><input type="radio" name="prise_en_charge" value="HDJ"
					<?php if(isset($hash_champ_valeur['prise_en_charge']) and $hash_champ_valeur['prise_en_charge'] == 'HDJ'){ echo "checked='checked'"; } ?> />HDJ</label><br />
				<label><input type="radio" name="prise_en_charge" value="CMD"
					<?php if(isset($hash_champ_valeur['prise_en_charge']) and $hash_champ_valeur['prise_en_charge'] == 'CMDt'){ echo "checked='checked'"; } ?> />CMD</label><br />
				<label><input type="radio" name="prise_en_charge"
					value="Hospitalisation complete"
					<?php if(isset($hash_champ_valeur['prise_en_charge']) and $hash_champ_valeur['prise_en_charge'] == 'Hospitalisation complete'){ echo "checked='checked'"; } ?> />Hospitalisation
					compl&egrave;te</label><br /> <label><input type="radio"
					name="prise_en_charge"
					value="Avis donne (sur dossier, par courrier, par telephone, par mail)"
					<?php if(isset($hash_champ_valeur['prise_en_charge']) and $hash_champ_valeur['prise_en_charge'] == 'Avis donne (sur dossier, par courrier, par telephone, par mail)'){ echo "checked='checked'"; } ?> />Avis
					donn&eacute; (sur dossier, par courrier , <br />par
					t&eacute;l&eacute;phone, par mail)</label><br /></td>
		</tr>

		<tr>
			<td><br /> <b>Contexte de la prise en charge/avis, <br /> patient
					adress&eacute; par :
			</b></td>
			<td><br /> <label><input type="radio" name="contexte_prise_en_charge"
					value="Suivi par le center"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Suivi par le center'){ echo "checked='checked'"; } ?> />Suivi
					par le center</label><br /> <label><input type="radio"
					name="contexte_prise_en_charge" value="Un generaliste (1er avis)"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Un generaliste (1er avis)'){ echo "checked='checked'"; } ?> />Un
					g&eacute;n&eacute;raliste (1er avis)</label><br /> <label><input
					type="radio" name="contexte_prise_en_charge"
					value="Un specialiste de ville (2nd avis)"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Un specialiste de ville (2nd avis)'){ echo "checked='checked'"; } ?> />Un
					sp&eacute;cialiste de ville (2nd avis)</label><br /> <label><input
					type="radio" name="contexte_prise_en_charge"
					value="Un specialiste hospitalier (2nd avis)"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Un specialiste hospitalier (2nd avis)'){ echo "checked='checked'"; } ?> />Un
					sp&eacute;cialiste hospitalier (2nd avis)</label><br /> <label><input
					type="radio" name="contexte_prise_en_charge"
					value="Une association (1er avis)"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Une association (1er avis)'){ echo "checked='checked'"; } ?> />Une
					association (1er avis)</label><br /> <label><input type="radio"
					name="contexte_prise_en_charge"
					value="Demarche personnelle (1er avis)"
					<?php if(isset($hash_champ_valeur['contexte_prise_en_charge']) and $hash_champ_valeur['contexte_prise_en_charge'] == 'Demarche personnelle (1er avis)'){ echo "checked='checked'"; } ?> />D&eacute;marche
					personnelle (1er avis)</label><br /></td>
		</tr>

		<tr>
			<td><br /> <b>Orientation personnalis&eacute;e </b></td>
			<td><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Orthophoniste"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Orthophoniste/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Orthophoniste</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Kine"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Kine/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Kin&eacute;</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Psychomotricien"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Psychomotricien/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Psychomotricien</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Dieteticien"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Dieteticien/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Di&eacute;t&eacute;ticien</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Psychologue"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Psychologue/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Psychologue
			</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Psychiatre"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Psychiatre/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Psychiatre
			</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Toxines"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Toxines/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Toxines
			</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Neuropsychologue"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Neuropsychologue/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Neuropsychologue</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Medecin traitant"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Medecin traitant/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>M&eacute;decin
					traitant</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="MPR"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/MPR/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>MPR</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Stimulation"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Stimulation/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Stimulation</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="EMG"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/EMG/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>EMG</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="IRM cerebrale"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/IRM cerebrale/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>IRM
					c&eacute;r&eacute;brale</label><br /></td>
			<td><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="MOC"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/MOC/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>MOC</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Hospitalisation"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Hospitalisation/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Hospitalisation</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="CMD"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/CMD/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>CMD</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Enreg. mvts anormaux"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Enreg. mvts anormaux/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Enreg.
					mvts anormaux</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="centerde competence"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/centerde competence/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>centerde
					comp&eacute;tence</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Protocole"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Protocole/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Protocole</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="ATU"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/ATU/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>ATU</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Assistante sociale"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Assistante sociale/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Assistante
					sociale</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Recherche genetique"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Recherche genetique/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Recherche
					g&eacute;n&eacute;tique</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Diagnostic genetique"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Diagnostic genetique/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Diagnostic
					g&eacute;n&eacute;tique</label><br /> <label><input type="checkbox"
					name="orientation_personnalisee[]" value="Metabolique"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Metabolique/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>M&eacute;tabolique</label><br />
				<label><input type="checkbox" name="orientation_personnalisee[]"
					value="Biologie courante"
					<?php if(isset($hash_champ_valeur['orientation_personnalisee']) and preg_match("/Biologie courante/", $hash_champ_valeur['orientation_personnalisee'])){ echo " checked='checked'"; } ?>>Biologie
					courante</label><br />
			
			<td><br />Autre, pr&eacute;ciser : <input type="text"
				style="width: 100px;" name="orientation_personnalisee_other"
				value="<?php if(isset($hash_champ_valeur['orientation_personnalisee_other'])){ echo strtoupper($hash_champ_valeur['orientation_personnalisee_other']); } ?>" /></td>
		</tr>

	<?php
	if ($_SESSION ['acces_clinique'] >= 2) {
		echo "<tr><td><input " . $disabled_tous . " type='submit' id='submitprinc' value='Save'/></td></tr>";
	}
	?>
	</table>
	
	<?php
	if ($_SESSION ['acces_clinique'] >= 2) {
		?></index><?php
	}
	?>



	



	<?php
}
?>
